#include <iostream>
#include <iomanip>
#include <vector>
#include <ctime>
#include <string>
#include "../head/Edge.h"
#include "../head/DenseGraph.h"
#include "../head/SparseGraph.h"
#include "../head/ReadGraph.h"
#include "../head/LazyPrim.h"
#include "../head/Prim.h"
#include "../head/Kruskal.h"

using namespace std;

void loadFile(int V, string filename, string testName);

int main(){
	// loadFile(8,"testG1.txt","Test for G1: ");
	// loadFile(250,"testG2.txt","Test for G2: ");
	loadFile(1000,"testG3.txt","Test for G3: ");
	loadFile(10000,"testG4.txt","Test for G4: ");
}

void loadFile(int V, string filename, string testName){
	SparseGraph<double> g = SparseGraph<double>(V, false);
	ReadGraph<SparseGraph<double>,double> readGraph(g, filename);
	cout<<filename<<" load successfully."<<endl;

	clock_t startTime, endTime;

	cout << "Test Lazy Prim MST: " << endl;
	startTime = clock();
	LazyPrimMST<SparseGraph<double>, double> lazyPrimMST(g);
	endTime = clock();
	cout << testName << (double)(endTime-startTime)/CLOCKS_PER_SEC<<" s."<<endl;
	cout << endl;

	cout<<"Test Prim MST:"<<endl;
	startTime = clock();
	PrimMST<SparseGraph<double>, double> PrimMST(g);
	endTime = clock();
	cout << testName << (double)(endTime-startTime)/CLOCKS_PER_SEC<<" s."<<endl;
	cout << endl;

	cout<<"Test Kruskal MST:"<<endl;
	startTime = clock();
	KruskalMST<SparseGraph<double>, double> KruskalMST(g);
	endTime = clock();
	cout << testName << (double)(endTime-startTime)/CLOCKS_PER_SEC<<" s."<<endl;
	cout << endl;
}
